DLinkList *Locate(DLinkList *L)
{
	DNode *p = L -> next;
	DNode *q;

	while (p != NULL && p -> data != x)
	{
		p = p -> next;
	}

	if (p == NULL)
	{
		printf("要查找的值不存在\n");
		return NULL;
	}
	else
	{
		p ->freq++;
		p -> next -> pre = p -> pre;
		p -> pre -> next = p -> next;
		q = p -> pre;

		while (q != L && q -> freq <= p -> freq)
		{
			q = q -> pre;
		}

		p -> next = q -> next;
		q -> next -> pre = p;
		p -> pre = q;
		q -> next = p;
	}

	return p;
}